@keyframes h5p-roll {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

// common styles
@bar-height: 2px;
@bar-color: silver;
@played-color: brown;
.h5p {
  background: #fff;
  box-shadow: 0 0 10px gray;
  position: relative;
  &-button {
    cursor: pointer;
    &:hover,
    &.h5p-active {
      color: dodgerblue;
    }
    svg {
      width: 20px;
      height: 20px;
      fill: currentColor;
    }
  }
  &-image {
    position: absolute;
    img {
      width: 100%;
      height: 100%;
    }
  }
  &-title {
    font-weight: bold;
  }
  &-bar {
    height: @bar-height;
    background: @bar-color;
    position: relative;
  }
  &-played {
    position: absolute;
    top: 0;
    height: @bar-height;
    background: @played-color;
  }
  &-playlist {
    display: none;
    max-height: 200px;
    border-top: 1px dashed gray;
    padding: 8px 16px;
    overflow-y: auto;
    & > div {
      white-space: nowrap;
      text-overflow: ellipsis;
      color: #1a1a1a;
      cursor: pointer;
      &.h5p-active {
        color: dodgerblue;
        font-weight: bold;
      }
      &:hover {
        color: orange;
      }
    }
  }
}

// Theme: normal
.h5p-normal {
  border-radius: 3px;
  max-width: 400px;
  font-size: 16px;
  .h5p-image {
    width: 130px;
    height: 130px;
    left: 10px;
    top: 10px;
    animation: h5p-roll 8s linear infinite;
    animation-play-state: paused;
    img {
      border-radius: 50%;
    }
  }
  .h5p-roll {
    animation-play-state: running;
  }
  .h5p-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    .h5p-button {
      margin-left: 5px;
    }
  }
  .h5p-info {
    height: 70px;
    padding: 30px 10px 0 150px;
    text-align: center;
  }
  .h5p-control {
    padding: 0 10px 20px 150px;
    text-align: center;
    .h5p-button {
      margin: 10px;
      font-size: 30px;
    }
  }
  .h5p-artist {
    height: 20px;
    font-size: 10px;
  }
  .h5p-lyric {
    height: 24px;
    text-align: center;
    color: brown;
    font-size: 12px;
  }
  @cur-color: white;
  @cur-height: 10px;
  @cur-width: 10px;
  .h5p-progress-wrap {
    padding: 5px 10px;
  }
  .h5p-progress {
    position: relative;
    padding: (@cur-height - @bar-height) / 2 0;
  }
  .h5p-cursor {
    position: absolute;
    width: @cur-width;
    height: @cur-height;
    top: 0;
    margin-left: -@cur-width / 2;
    border: 1px solid @bar-color;
    border-radius: 50%;
    background: @cur-color;
    cursor: pointer;
  }
  .h5p-time {
    position: absolute;
    top: -20px;
    right: 0;
    font-size: 10px;
  }
}

// Theme: simple
.h5p-simple {
  max-width: 300px;
  height: 36px;
  border-radius: 2px;
  .h5p-image {
    width: 34px;
    height: 34px;
  }
  .h5p-toolbar,
  .h5p-lyric,
  .h5p-time {
    display: none;
  }
  .h5p-info {
    position: absolute;
    top: 0;
    left: 40px;
    right: 72px;
    line-height: 34px;
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    & > * {
      margin: 0 5px;
    }
  }
  .h5p-control {
    position: absolute;
    top: 0;
    right: 5px;
    line-height: 34px;
    .h5p-button {
      display: inline-block;
      margin: 0 5px;
      font-size: 18px;
    }
  }
  .h5p-title,
  .h5p-artist {
    display: inline;
  }
  .h5p-progress-wrap {
    position: absolute;
    bottom: 0;
    width: 100%;
  }
}
